//
//  DYJQTuigaiCell.swift
//  SheYangBigData
//
//  Created by 叁拾叁 on 2021/2/4.
//  Copyright © 2021 叁拾叁. All rights reserved.
//


import UIKit
import YYText

class DYJQTuigaiCell: SYBaseCell {

    var bgView: UIView = {
        let v: UIView = UIView()
        v.backgroundColor = .white
        v.layer.cornerRadius = 5
        v.layer.masksToBounds = true
        return v
    }()
    
    let tuigai: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 18.autoBoldFontSize()
        v.text  = "退改规则"
        return v
    }()
    
    let gongyingshang: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 18.autoBoldFontSize()
        v.text  = "供应商电话"
        return v
    }()
    
    
    let guizeT: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x999999)
        v.font = 15.autoFontSize()
        v.text = "退款规则如下:"
        return v
    }()
    
    let guizeFir: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x999999)
        v.font = 15.autoFontSize()
        v.text = "未消费可随时退款，3个工作日完成退款审核。"
        return v
    }()
    let guizeSec: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x999999)
        v.font = 15.autoFontSize()
        v.text = "过期后未消费自动申请退款。"
        return v
    }()
    
    let guizeThir: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x999999)
        v.font = 15.autoFontSize()
        v.text = "下单后不支持改期。"
        return v
    }()
    
    let gongying: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x999999)
        v.font = 15.autoFontSize()
        v.text = "催出票/协商退改"
        return v
    }()
    

    let tuigaiLabelFir: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x5D99FB)
        v.font = 15.autoFontSize()
        v.text = " 未用随时退 "
        v.backgroundColor = UIColor(hex: 0xECF2FD)
        v.layer.cornerRadius = 3.autoWidth()
        return v
    }()
    let tuigaiLabelSec: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x5D99FB)
        v.font = 15.autoFontSize()
        v.text = " 过期自动退 "
        v.backgroundColor = UIColor(hex: 0xECF2FD)
        v.layer.cornerRadius = 3.autoWidth()
        return v
    }()
    
    let imgView: UIImageView = {
        let v = UIImageView()
        v.image = UIImage(named: "jingqu_dianhua")
        return v
    }()

    
    
    func configure(_ model: RYDingdanModel) {
        
    }

    override func initViews() {
        
        self.backgroundColor = .clear
        addSubview(bgView)
        bgView.addSubview(tuigai)
        
        bgView.addSubview(gongyingshang)
        bgView.addSubview(tuigaiLabelFir)
        bgView.addSubview(tuigaiLabelSec)
        bgView.addSubview(guizeT)
        
        bgView.addSubview(guizeFir)
        bgView.addSubview(guizeSec)
        bgView.addSubview(guizeThir)
        bgView.addSubview(gongying)
        bgView.addSubview(imgView)
        bgView.addSubview(lineView)
        
        tuigai.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(20.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(18.autoWidth())
        }
        guizeT.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(52.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(14.autoWidth())
        }
      
        tuigaiLabelFir.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(82.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(23.autoWidth())
        }
        tuigaiLabelSec.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(152.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(23.autoWidth())
        }
        guizeFir.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(120.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(15.autoWidth())
        }
        guizeSec.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(190.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(15.autoWidth())
        }
        guizeThir.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(220.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(15.autoWidth())
        }
        gongyingshang.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(268.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(18.autoWidth())
        }
        gongying.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(300.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(15.autoWidth())
            make.bottom.equalToSuperview().offset(-22.5.autoWidth())
        }
        imgView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(264.autoWidth())
            make.right.equalToSuperview().offset(-10.autoWidth())
            make.width.height.equalTo(27.autoWidth())
        }
        lineView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(248.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.right.equalToSuperview().offset(-10.autoWidth())
            make.height.equalTo(0.5.autoWidth())
        }
        
        bgView.snp.makeConstraints { (make) in
            make.top.equalToSuperview()
            make.bottom.equalToSuperview().offset(-10.autoWidth())
            make.left.equalToSuperview()
            make.right.equalToSuperview()
        }
    }
}
